# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-uri-escape
_pkgname=URI
pkgver=1.76
pkgrel=5
pkgdesc='Percent-encode and percent-decode unsafe characters.'
arch=('any')
url='https://metacpan.org/pod/URI::Escape'
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl')
source=("https://cpan.metacpan.org/authors/id/O/OA/OALDERS/$_pkgname-$pkgver.tar.gz")
sha512sums=('1fcb02692bdf5f223c2878569615d153b3c4c5adc04c33aee23f3f015e08b4895b03536ef3a8c7cb7a334c2faa056e5e46c805d56d810704cba63d96136e0a83')

build() {
  (
    export PERL_MM_USE_DEFAULT=1 PERL5LIB="" PERL_AUTOINSTALL=--skipdeps \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'"     \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null

    cd "URI-$pkgver"

    perl Makefile.PL

    make
  )
}

package() {
  cd "URI-$pkgver"

  make install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

